Status Check
Running the deposit-flow script often finishes with a depositSubmit result that looks something like this:
{
"depositSubmit": {
"blockchainStatus": "PENDING"
}
}
This does not mean the deposit failed, but instead that the transaction was submitted and is still processing. To verify the final outcome, you need to follow these steps, which will be explained in more details below:
- Find the
depositIdfrom within thedepositCreateblock in the output - Generate a fresh
BENJI_ACCESS_TOKEN - Run a
depositquery with thatdepositId - Inspect
blockchainStatus - Optional: Repeat until the status becomes terminal if needed
1. Find and capture the depositCreate block in the output
This is the part of the console output that matters for the later status check:
{
"depositCreate": {
"depositId": "YOUR_DEPOSIT_ID",
"approvalsRequired": 0
}
}
You are not using depositCreate itself to check final status. You are using the depositId from that block as input to a later deposit query.
Copy this from the depositCreate output block and set it directly in your terminal:
$depositId = "YOUR_DEPOSIT_ID"
2. Generate a fresh BENJI_ACCESS_TOKEN
Run this in the same PowerShell terminal. It generates a new OAuth access token and stores it in $env:BENJI_ACCESS_TOKEN.
$env:BENJI_ACCESS_TOKEN = @'
import * as jose from "jose";
import { SignJWT } from "jose";
import { randomUUID } from "crypto";
const oktaUrl = process.env.BENJI_OKTA_URL ?? "https://login-preview.digitalassets.franklintempleton.com/oauth2/aus3nefxjv7YUkjW31d7/v1/token";
const clientId = process.env.BENJI_CLIENT_ID;
const priKey = JSON.parse(process.env.BENJI_PRI_KEY_JSON);
const jwkPriKey = await jose.importJWK(priKey, "ES256");
const jwt = await new SignJWT()
.setProtectedHeader({ alg: "ES256", kid: priKey.kid })
.setIssuer(clientId)
.setSubject(clientId)
.setAudience(oktaUrl)
.setExpirationTime("5m")
.setJti(randomUUID())
.sign(jwkPriKey);
const params = new URLSearchParams();
params.append("grant_type", "client_credentials");
params.append("scope", "statements.readonly statements bank_transactions creator_transactions");
params.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer");
params.append("client_assertion", jwt);
const resp = await fetch(oktaUrl, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json"
},
body: params
});
const data = await resp.json();
if (!data.access_token) {
console.error(JSON.stringify(data, null, 2));
process.exit(1);
}
process.stdout.write(data.access_token);
'@ | node --input-type=module -
Optional check:
If this command returns a nonzero number, a new BENJI_ACCESS_TOKEN was generated correctly.
$env:BENJI_ACCESS_TOKEN.Length
3. Run the deposit query
Now query the deposit using the captured depositId and the fresh bearer token:
$body = @{
query = 'query ($depositId: ID!) { deposit(depositId: $depositId) { depositId blockchainStatus approvalsRequired approvalsCollected value } }'
variables = @{ depositId = $depositId }
} | ConvertTo-Json -Depth 10
$result = Invoke-RestMethod `
-Uri "https://api-uat.frk.com/tf/platform/bve/graphql" `
-Method POST `
-Headers @{ Authorization = "Bearer $env:BENJI_ACCESS_TOKEN" } `
-ContentType "application/json" `
-Body $body
$result | ConvertTo-Json -Depth 10
4. Inspect blockchainStatus
When the query comes back, the most important field is blockchainStatus. That field tells you whether the deposit is still processing or whether it has reached a terminal state.
The main field to watch is blockchainStatus.
Expected statuses from the live schema:
COMPLETE- the deposit finished successfullyPENDING- the deposit was submitted and is still processingFAILED- the deposit reached a terminal failure stateTIMED_OUT- the deposit did not complete in time and requires follow-upAPPROVAL_NEEDED- more approvals are still required before submission is possibleREADY_TO_SUBMIT- approvals are sufficient and the transaction is ready for submission
For example, a successful final response looks like:
{
"data": {
"deposit": {
"depositId": "YOUR_DEPOSIT_ID",
"blockchainStatus": "COMPLETE",
"approvalsRequired": 0,
"approvalsCollected": 1,
"value": "YOUR_DEPOSIT_VALUE"
}
}
}
5. Repeat until terminal if needed
If the result is PENDING, query it again after a short delay.
Stop when the deposit reaches one of these terminal states:
COMPLETEFAILEDTIMED_OUT
Common mistakes
- querying with no bearer token set
- using an expired bearer token
- copying the wrong
depositId - confusing the immediate
depositSubmitstatus with the final deposit status